package com.jctrip.hotel.management.model.result;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@ApiModel(value = "订单展示接口-返回值")
@Data
@Accessors(chain = true)
public class GetOrderListResult implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单列表")
    private List<OrderInfo> orderList;

    @ApiModelProperty(value = "订单总数")
    private Long total;

    @ApiModelProperty(value = "当前页码")
    private Integer pageNum;

    @ApiModelProperty(value = "当前页面大小")
    private Integer pageSize;

    @ApiModel(value = "订单对象")
    @Data
    public static class OrderInfo implements Serializable{
        private static final long serialVersionUID = 1L;
        @ApiModelProperty(value = "订单号")
        private String orderId;

        @ApiModelProperty(value = "渠道编号")
        private String routeId;

        @ApiModelProperty(value = "酒店编号")
        private String hotelId;

        @ApiModelProperty(value = "房型编号")
        private String roomTypeCode;

        @ApiModelProperty(value = "渠道单号")
        private String routeOrderId;

        @ApiModelProperty(value = "渠道名-政策名")
        private String routeChannelName;

        @ApiModelProperty(value = "酒店编号")
        private String routeHotelId;

        @ApiModelProperty(value = "酒店名")
        private String routeHotelName;

        @ApiModelProperty(value = "房型编号")
        private String routeRoomTypeCode;

        @ApiModelProperty(value = "房型名")
        private String routeRoomTypeName;

        @ApiModelProperty(value = "房价计划")
        private String routeRatePlanName;

        @ApiModelProperty(value = "预定人")
        private String contactName;

        @ApiModelProperty(value = "预定电话")
        private String contactTel;

        @ApiModelProperty(value = "入住人姓名")
        private String guestName;

        @ApiModelProperty(value = "库存类型(0=未知；1=限售库存；2=保留房库存；3=物理库存；4=超预定库存)")
        private Integer stockType;

        @ApiModelProperty(value = "售价类型(0=卖价模式；1=底价模式)")
        private Integer priceType;

        @ApiModelProperty(value = "支付类型(1=预付；2=现付；3=信用类后付)")
        private Integer paymentType;

        @ApiModelProperty(value = "预估利润")
        private BigDecimal profitPrice;

        @ApiModelProperty(value = "企业名称")
        private String companyName;

        @ApiModelProperty(value = "是否为企业支付(0=否；1=是)")
        private Integer companyPayment;

        @ApiModelProperty(value = "早餐(0=不含早,N=实际含早份数)")
        private Integer breakfastCount;

        @ApiModelProperty(value = "入住日期")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date arriveDate;

        @ApiModelProperty(value = "退房日期")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date departDate;

        @ApiModelProperty(value = "间夜")
        private Long roomNight;

        @ApiModelProperty(value = "间数")
        private Integer roomCount;

        @ApiModelProperty(value = "支付金额")
        private BigDecimal paymentPrice;

        @ApiModelProperty(value = "实收金额")
        private BigDecimal receivablePrice;

        @ApiModelProperty(value = "供应订单列表")
        private List<SourceOrderInfo> sourceOrderList;

        @ApiModelProperty(value = "订单创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date orderCreateTime;

        @ApiModelProperty(value = "订单申请推款时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date orderRefundTime;

        @ApiModelProperty(value = "人工备注")
        private String manualNotes;

        @ApiModelProperty(value = "渠道订单状态(0-未支付；10-已支付；20-已确认；21-拒绝新订；30-已完成；40-申请取消；41-同意取消；42-拒绝取消；50-已退款)")
        private Integer routeOrderStatus;
    }

    @ApiModel(value = "供应订单对象")
    @Data
    public static class SourceOrderInfo implements Serializable{
        private static final long serialVersionUID = 1L;
        @ApiModelProperty(value = "供应来源")
        private String sourceCode;

        @ApiModelProperty(value = "预定单号")
        private String bookId;

        @ApiModelProperty(value = "币种")
        private String currencyCode;

        @ApiModelProperty(value = "供应订单号")
        private String sourceOrderId;

        @ApiModelProperty(value = "采购金额")
        private BigDecimal purchasePrice;

        @ApiModelProperty(value = "操作人")
        private String operator;

        @ApiModelProperty(value = "供应订单状态(0-待确认,1-预定成功,2-已取消,3-预定未到,4-已入住,5-已离店,6-预定失败)")
        private Integer sourceOrderStatus;

        @ApiModelProperty(value = "供应名称")
        private String sourceName;

        @ApiModelProperty(value = "供应支付状态(0-未支付；1-已支付；2-退款处理中；3-已退款)")
        private Integer sourcePaymentStatus;

        @ApiModelProperty(value = "酒店编号")
        private String hotelId;

        @ApiModelProperty(value = "酒店名")
        private String hotelName;

        @ApiModelProperty(value = "房型编号")
        private String roomTypeCode;

        @ApiModelProperty(value = "房型名称")
        private String roomTypeName;

        @ApiModelProperty(value = "联系人")
        private String contactName;

        @ApiModelProperty(value = "联系方式")
        private String contactTel;

        @ApiModelProperty(value = "入住人")
        private String guestName;

        @ApiModelProperty(value = "抵店时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date realArriveTime;

        @ApiModelProperty(value = "离店时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date realDepartTime;

        @ApiModelProperty(value = "退款金额")
        private BigDecimal refundPrice;

        @ApiModelProperty(value = "错误原因")
        private String orderNotes;
    }
}
